package cn.itcast.service.impl;

import cn.itcast.dao.StudentDao;
import cn.itcast.domain.Student;
import cn.itcast.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentDao studentDao;

    @Override
    public List<Student> findAll() throws Exception {
        List<Student> all = studentDao.findAll();
        return all;
    }

    @Override
    public void save(Student student) throws Exception {
        studentDao.save(student);

    }
    @Override
    public void delete(Integer id) throws Exception {
        studentDao.delete(id);
    }

    @Override
    public void update(Student student) throws Exception {
        studentDao.update(student);
    }

    @Override
    public List<Student> findBy(Integer id) {
        List<Student> list = studentDao.findBy(id);
        return list;
    }
}

